#include "Globals.h"
#include "cBoira.h"


cBoira::cBoira(void)
{
}


cBoira::~cBoira(void)
{
}

void cBoira::Init(){
	GLuint filter;						// Which Filter To Use
	GLuint fogMode[]= { GL_EXP, GL_EXP2, GL_LINEAR };	// Storage For Three Types Of Fog
	GLuint fogfilter= 1;					// Which Fog To Use
	GLfloat fogColor[4]= {0.5f, 0.5f, 0.5f, 1.0f};		// Fog Color
	density = 0.035f;
	start_depth = 10.0f;
	end_depth = 12.0f;
	glFogi(GL_FOG_MODE, fogMode[fogfilter]);// Fog Mode
	glFogfv(GL_FOG_COLOR, fogColor);	// Set Fog Color
	glFogf(GL_FOG_DENSITY, density);		// How Dense Will The Fog Be
	glHint(GL_FOG_HINT, GL_DONT_CARE);	// Fog Hint Value
	glFogf(GL_FOG_START, start_depth);		// Fog Start Depth
	glFogf(GL_FOG_END, end_depth);		// Fog End Depth
}

void cBoira::Active(){
	glEnable(GL_FOG);			// Enables GL_FOG
}

void cBoira::Disactive(){
	glDisable(GL_FOG);
}

void cBoira::SetDensity(float density){
	this->density = density;
	glFogf(GL_FOG_DENSITY, density);		// How Dense Will The Fog Be
}

void cBoira::SetDepth(float start, float end){
	this->start_depth = start;
	this->end_depth = end;
	glFogf(GL_FOG_START, start);		// Fog Start Depth
	glFogf(GL_FOG_END, end);		// Fog End Depth
}

